<template>
    <div>
        <div v-if="opponent.skippedTurn">{{opponent.name}} turn was skippede!</div>
        <template v-else>
            <div>{{opponent.name}} just played: </div>
            <Card :def="lastPlayedCard" />
        </template>
    </div>
</template>

<script>
import Card from './card'
import {getLastPlayedCard} from '../util.js'
console.log(getLastPlayedCard)
export default {
    props: ['opponent', 'cards'],
    components: {
        Card,
    },
    computed: {
        lastPlayedCard() {
            return getLastPlayedCard(this.opponent, this.cards)
        }
    }
}
</script>

<style>

</style>
